package com.guet.niit.util;

import com.sun.javafx.stage.StageHelper;
import javafx.collections.ObservableList;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

import java.io.IOException;

public class UserBacktrack {
    /**
     * 返回用户菜单
     */
    public static void backtrack(Class T){
        //引用fxml样式
        Parent load = null;
        try {
            load = FXMLLoader.load(T.getClass().getResource("/fxml/user/userMenu.fxml"));
        } catch (IOException e) {
            e.printStackTrace();
        }
        ObservableList<Stage> stageList = StageHelper.getStages();
        stageList.get(0).setScene(new Scene(load));
    }
}
